import React from 'react';
import './check.scss';
import ImageLoadable from "components/plugins/imageLoading/imageLoading";
import {formatClassList} from "auxiliaries/extends/format";

class Avatar extends React.Component {

    render() {
        let {
            src,
            className
        } = this.props;

        return (
            <div className={["avatar"].concat(formatClassList(className)).join(' ')} style={{
                backgroundImage: `url('${src}')`,
                backgroundSize: 'cover',
                backgroundPosition: 'center'
            }}>
                <ImageLoadable src={src}/>
                {this.props.children}
            </div>
        );
    }
}

export default Avatar;